Elyes Haouas has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/71612 )
Change subject: contributing/coding_style.md: Add and clarify includes rules
......................................................................
contributing/coding_style.md: Add and clarify includes rules
Change-Id: I3af2c3b15dda7e8b095767084dae8ee24d478256
Signed-off-by: Elyes Haouas <ehaouas(a)noos.fr>
---
M Documentation/contributing/coding_style.md
1 file changed, 33 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/12/71612/1
diff --git a/Documentation/contributing/coding_style.md b/Documentation/contributing/coding_style.md
index 5b2919e3..e1199d8 100644
--- a/Documentation/contributing/coding_style.md
+++ b/Documentation/contributing/coding_style.md
@@ -921,9 +921,29 @@
"file.h"`. Local "file.h" includes should always come separately after all
<file.h> includes. Headers that can be included from both assembly files and
.c files should keep all C code wrapped in `#ifndef __ASSEMBLER__` blocks,
-including includes to other headers that don't follow that provision. Where a
-specific include order is required for technical reasons, it should be clearly
-documented with comments.
+including includes to other headers that don't follow that provision.
+The includes should be ordered alphabetically. Where a specific include order is
+required for technical reasons, it should be clearly documented with comments.
+Don't use UNIX directory '.' or '..' shortcuts and put conditional includes
+after the other includes.
+
+Example:
+```c
+#include <related_headers.h>
+#ifdef CONDITION
+#include <conditional_headers.h>
+#endif
+One blank line
+#include "local_headers.h"
+#ifdef LOCAL_CONDITION
+#include "local_conditional_headers.h"
+#endif
+One blank line
+#include <vendorcode/headers.h>
+#ifdef VENDOR_CONDITION
+#include <vendor_conditional_headers.h>
+#endif
+```
Files should generally include every header they need a definition from
directly (and not include any unnecessary extra headers). Excepted from
--
To view, visit https://review.coreboot.org/c/coreboot/+/71612
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I3af2c3b15dda7e8b095767084dae8ee24d478256
Gerrit-Change-Number: 71612
Gerrit-PatchSet: 1
Gerrit-Owner: Elyes Haouas <ehaouas(a)noos.fr>
Gerrit-MessageType: newchange
Subrata Banik has submitted this change. ( https://review.coreboot.org/c/coreboot/+/71265 )
Change subject: drivers/pc80/vga: Add API to write multi-line video message
......................................................................
drivers/pc80/vga: Add API to write multi-line video message
This patch provides an API to allow users to output multi-line
messages using VGA framebuffer.
The current limitation with multiline message is that,
vga_line_write() function is unable to understand newline character
hence, eventually output multiple lines separated with a newline
character with a single line statement.
This patch ensures to parse the entire string and split it into
multiple lines based on the newline character and print each line
separately to the VFG framebuffer.
User can choose to align the output video message as per given choice
between left/center/right of the screen
(i.e. enum VGA_TEXT_ALIGNMENT ).
Additionally, added macros to define the horizontal screen alignment
as well. Ideally if user would like to print the video message at the
middle of the screen then the vertical alignment would be
`VGA_TEXT_CENTER` and horizontal alignment would be
`VGA_TEXT_HORIZONTAL_MIDDLE`.
TEST=Able to build and boot Google/Taeko.
While output a video message such as :
"Your device is finishing an update. This may take 1-2 minutes.\nPlease
do not turn off your device."
Without this patch:
Your device is finishing an update. This may take 1-2 minutes. nPlease
do not turn off your device.
With this patch:
(in Left Alignment):
Your device is finishing an update. This may take 1-2 minutes.
Please do not turn off your device.
(in Right Alignment):
Your device is finishing an update. This may take 1-2 minutes.
Please do not turn off your device.
(in Center Alignment):
Your device is finishing an update. This may take 1-2 minutes.
Please do not turn off your device.
Signed-off-by: Subrata Banik <subratabanik(a)google.com>
Change-Id: Ib837e4deeba9b84038a91c93a68f03cee3474f9b
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71265
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Tarun Tuli <taruntuli(a)google.com>
---
M src/drivers/pc80/vga/vga.c
M src/include/pc80/vga.h
2 files changed, 117 insertions(+), 9 deletions(-)
Approvals:
build bot (Jenkins): Verified
Tarun Tuli: Looks good to me, approved
diff --git a/src/drivers/pc80/vga/vga.c b/src/drivers/pc80/vga/vga.c
index 3471c94..a52ba6d 100644
--- a/src/drivers/pc80/vga/vga.c
+++ b/src/drivers/pc80/vga/vga.c
@@ -256,23 +256,55 @@
vga_cr_write(0x0D, offset & 0xFF);
}
+static void
+vga_write_at_offset(unsigned int line, unsigned int offset, const char *string)
+{
+ if (!string)
+ return;
+
+ unsigned short *p = (unsigned short *)VGA_FB + (VGA_COLUMNS * line) + offset;
+ size_t i, len = strlen(string);
+
+ for (i = 0; i < (VGA_COLUMNS - offset); i++) {
+ if (i < len)
+ p[i] = 0x0F00 | string[i];
+ else
+ p[i] = 0x0F00;
+ }
+}
+
/*
* simply fills a line with the given string.
*/
void
vga_line_write(unsigned int line, const char *string)
{
- if (!string)
- return;
+ vga_write_at_offset(line, 0, string);
+}
- unsigned short *p = (unsigned short *)VGA_FB + (VGA_COLUMNS * line);
- size_t i, len = strlen(string);
+void
+vga_write_text(enum VGA_TEXT_ALIGNMENT alignment, unsigned int line, const char *string)
+{
+ char str[VGA_COLUMNS * VGA_LINES] = {0};
+ memcpy(str, string, strnlen(string, sizeof(str) - 1));
- for (i = 0; i < VGA_COLUMNS; i++) {
- if (i < len)
- p[i] = 0x0F00 | string[i];
- else
- p[i] = 0x0F00;
+ char *token = strtok(str, "\n");
+
+ while (token != NULL) {
+ size_t offset = VGA_COLUMNS - strnlen(token, VGA_COLUMNS);
+ switch (alignment) {
+ case VGA_TEXT_CENTER:
+ vga_write_at_offset(line++, offset/2, token);
+ break;
+ case VGA_TEXT_RIGHT:
+ vga_write_at_offset(line++, offset, token);
+ break;
+ case VGA_TEXT_LEFT:
+ default:
+ vga_write_at_offset(line++, 0, token);
+ break;
+ }
+ token = strtok(NULL, "\n");
}
}
diff --git a/src/include/pc80/vga.h b/src/include/pc80/vga.h
index 4b7b26c..ec012f5 100644
--- a/src/include/pc80/vga.h
+++ b/src/include/pc80/vga.h
@@ -8,6 +8,15 @@
#define VGA_COLUMNS 80
#define VGA_LINES 25
+#define VGA_TEXT_HORIZONTAL_TOP 0
+#define VGA_TEXT_HORIZONTAL_MIDDLE (VGA_LINES / 2)
+
+enum VGA_TEXT_ALIGNMENT {
+ VGA_TEXT_LEFT,
+ VGA_TEXT_CENTER,
+ VGA_TEXT_RIGHT,
+};
+
void vga_io_init(void);
void vga_textmode_init(void);
@@ -20,4 +29,10 @@
void vga_line_write(unsigned int line, const char *string);
+/*
+ * vga_write_text() writes a line of text aligned left/center/right
+ * horizontally on the screen (i.e. enum VGA_TEXT_ALIGNMENT)
+ */
+void vga_write_text(enum VGA_TEXT_ALIGNMENT alignment, unsigned int line, const char *string);
+
#endif /* VGA_H */
--
To view, visit https://review.coreboot.org/c/coreboot/+/71265
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib837e4deeba9b84038a91c93a68f03cee3474f9b
Gerrit-Change-Number: 71265
Gerrit-PatchSet: 8
Gerrit-Owner: Subrata Banik <subratabanik(a)google.com>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Jeremy Compostella <jeremy.compostella(a)gmail.com>
Gerrit-Reviewer: Kapil Porwal <kapilporwal(a)google.com>
Gerrit-Reviewer: Subrata Banik <subratabanik(a)google.com>
Gerrit-Reviewer: Tarun Tuli <taruntuli(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: merged
Attention is currently required from: Subrata Banik, Eric Lai.
Meera Ravindranath has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/69431 )
Change subject: src/drivers/usb: Add support for Bluetooth PPAG
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS2:
> What is the PPAG? Could you elaborate here?
PPAG is per platform antenna gain. This is a feature used for performance improvement in BT. please refer to the crosbug for a detailed explanation.
--
To view, visit https://review.coreboot.org/c/coreboot/+/69431
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ie264edf188532fe6c260275edaa694cf3b3605d3
Gerrit-Change-Number: 69431
Gerrit-PatchSet: 2
Gerrit-Owner: Meera Ravindranath <meera.ravindranath(a)intel.com>
Gerrit-Reviewer: Eric Lai <eric_lai(a)quanta.corp-partner.google.com>
Gerrit-Reviewer: Subrata Banik <subratabanik(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Subrata Banik <subratabanik(a)google.com>
Gerrit-Attention: Eric Lai <eric_lai(a)quanta.corp-partner.google.com>
Gerrit-Comment-Date: Mon, 02 Jan 2023 05:39:46 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Eric Lai <eric_lai(a)quanta.corp-partner.google.com>
Gerrit-MessageType: comment
Attention is currently required from: Subrata Banik, Paul Menzel, Pratikkumar V Prajapati.
Sridhar Siricilla has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/71117 )
Change subject: soc/intel/common: Add API to check Key Locker support
......................................................................
Patch Set 7: Code-Review+2
--
To view, visit https://review.coreboot.org/c/coreboot/+/71117
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ide9e59a4f11a63df48838eab02c2c584cced12e1
Gerrit-Change-Number: 71117
Gerrit-PatchSet: 7
Gerrit-Owner: Pratikkumar V Prajapati <pratikkumar.v.prajapati(a)intel.com>
Gerrit-Reviewer: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Gerrit-Reviewer: Subrata Banik <subratabanik(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Subrata Banik <subratabanik(a)google.com>
Gerrit-Attention: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Pratikkumar V Prajapati <pratikkumar.v.prajapati(a)intel.com>
Gerrit-Comment-Date: Mon, 02 Jan 2023 03:58:27 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment