Skip to content

Commit

Permalink
Inital Lenovo IdeaPad Yoga 11 commit
Browse files Browse the repository at this point in the history
  • Loading branch information
LeanderGlanda committed Aug 21, 2021
1 parent 5cbc083 commit 93f4636
Show file tree
Hide file tree
Showing 3 changed files with 137 additions and 5 deletions.
1 change: 1 addition & 0 deletions arch/arm/boot/dts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1289,6 +1289,7 @@ dtb-$(CONFIG_ARCH_TEGRA_3x_SOC) += \
tegra30-cardhu-a04.dtb \
tegra30-colibri-eval-v3.dtb \
tegra30-lenovo-ideatab-a2109a.dtb \
tegra30-lenovo-ideapad-yoga-11.dtb \
tegra30-microsoft-surface-rt.dtb \
tegra30-microsoft-surface-rt-efi.dtb \
tegra30-ouya.dtb \
Expand Down
128 changes: 128 additions & 0 deletions arch/arm/boot/dts/tegra30-lenovo-ideapad-yoga-11.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
// SPDX-License-Identifier: GPL-2.0

/dts-v1/;

#include <dt-bindings/input/input.h>
#include "tegra30.dtsi"

/ {
model = "Lenovo IdeaPad Yoga 11";
compatible = "lenovo,ideapad-yoga-11", "nvidia,tegra30";

/* clock from PMIC */
clk32k_in: clock@0 {
compatible = "fixed-clock";
clock-frequency = <32768>;
#clock-cells = <0>;
};

pinmux@70000868 {
pinctrl-names = "default";
pinctrl-0 = <&state_default>;

state_default: pinmux {
/* HDMI HOTPLUG_DETECT */
/*hdmi-int-pn7 {
nvidia,pins = "hdmi_int_pn7";
nvidia,function = "hdmi";
nvidia,pull = <TEGRA_PIN_PULL_NONE>;
nvidia,tristate = <TEGRA_PIN_ENABLE>;
nvidia,enable-input = <TEGRA_PIN_ENABLE>;
};*/

/* Backlight PWM */
/*gmi-ad8-ph0 {
nvidia,pins = "gmi_ad8_ph0";
nvidia,function = "pwm0";
nvidia,pull = <TEGRA_PIN_PULL_NONE>;
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_DISABLE>;
};*/
};
};

panel: display-panel {
compatible = "samsung,ltn140at29-301";

power-supply = <&vdd_pnl>;
backlight = <&backlight>;

port {
panel_input: endpoint {
remote-endpoint = <&lvds_encoder_output>;
};
};
};

vdd_pnl: vdd-panel {
compatible = "regulator-fixed";
regulator-name = "vdd_panel";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
regulator-always-on;
//gpio = <&gpio TEGRA_GPIO(L, 4) GPIO_ACTIVE_HIGH>;
enable-active-high;
};

backlight: backlight {
compatible = "pwm-backlight";
//enable-gpios = <&gpio TEGRA_GPIO(H, 2) GPIO_ACTIVE_HIGH>;
pwms = <&pwm 0 50000>;
brightness-levels = <1 255>;
num-interpolated-steps = <254>;
default-brightness-level = <128>;
};

pwm@7000a000 {
status = "okay";
};

host1x@50000000 {
hdmi@54280000 {
status = "okay";
//nvidia,ddc-i2c-bus = <&hdmi_ddc>;
nvidia,hpd-gpio = <&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
};

dc@54200000 {
rgb {
status = "okay";

port@0 {
lcd_output: endpoint {
remote-endpoint = <&lvds_encoder_input>;
bus-width = <24>;
};
};
};
};
};

lvds-encoder {
compatible = "lvds-encoder";

//powerdown-gpios = <&gpio TEGRA_GPIO(C, 1) GPIO_ACTIVE_LOW>;

ports {
#address-cells = <1>;
#size-cells = <0>;

port@0 {
reg = <0>;

lvds_encoder_input: endpoint {
remote-endpoint = <&lcd_output>;
};
};

port@1 {
reg = <1>;

lvds_encoder_output: endpoint {
remote-endpoint = <&panel_input>;
};
};
};
};
};
13 changes: 8 additions & 5 deletions drivers/firmware/efi/libstub/efi-stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle,
struct screen_info *si;
efi_properties_table_t *prop_tbl;
unsigned long max_addr;
/* Use https://www.rapidtables.com/convert/number/ascii-to-hex.html to create a different cmdline */
static u8 new_cmdline[] = {0x7a, 0x00, 0x49, 0x00, 0x6d, 0x00, 0x61, 0x00, 0x67, 0x00, 0x65, 0x00, 0x20, 0x00, 0x64, 0x00, 0x74, 0x00, 0x62, 0x00, 0x3d, 0x00, 0x74, 0x00, 0x65, 0x00, 0x67, 0x00, 0x72, 0x00, 0x61, 0x00, 0x33, 0x00, 0x30, 0x00, 0x2d, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x6f, 0x00, 0x76, 0x00, 0x6f, 0x00, 0x2d, 0x00, 0x69, 0x00, 0x64, 0x00, 0x65, 0x00, 0x61, 0x00, 0x70, 0x00, 0x61, 0x00, 0x64, 0x00, 0x2d, 0x00, 0x79, 0x00, 0x6f, 0x00, 0x67, 0x00, 0x61, 0x00, 0x2d, 0x00, 0x31, 0x00, 0x31, 0x00, 0x2e, 0x00, 0x64, 0x00, 0x74, 0x00, 0x62, 0x00, 0x20, 0x00, 0x65, 0x00, 0x61, 0x00, 0x72, 0x00, 0x6c, 0x00, 0x79, 0x00, 0x70, 0x00, 0x72, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x6b, 0x00, 0x3d, 0x00, 0x65, 0x00, 0x66, 0x00, 0x69, 0x00, 0x2c, 0x00, 0x6b, 0x00, 0x65, 0x00, 0x65, 0x00, 0x70, 0x00, 0x20, 0x00, 0x62, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x74, 0x00, 0x5f, 0x00, 0x64, 0x00, 0x65, 0x00, 0x6c, 0x00, 0x61, 0x00, 0x79, 0x00, 0x3d, 0x00, 0x31, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x20, 0x00, 0x63, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x73, 0x00, 0x6f, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x3d, 0x00, 0x74, 0x00, 0x74, 0x00, 0x79, 0x00, 0x30, 0x00, 0x20, 0x00, 0x72, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x74, 0x00, 0x77, 0x00, 0x61, 0x00, 0x69, 0x00, 0x74, 0x00};

efi_system_table = sys_table_arg;

Expand All @@ -160,6 +162,10 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle,
goto fail;
}

/* Patch kernel command line */
image->load_options = new_cmdline;
image->load_options_size = sizeof(new_cmdline) / 2;

/*
* Get the command line from EFI, using the LOADED_IMAGE
* protocol. We are going to copy the command line into the
Expand Down Expand Up @@ -211,12 +217,9 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle,
secure_boot = efi_get_secureboot();

/*
* Unauthenticated device tree data is a security hazard, so ignore
* 'dtb=' unless UEFI Secure Boot is disabled. We assume that secure
* boot is enabled if we can't determine its state.
* Ignoring secure boot state. Loading a DTB either way.
*/
if (!IS_ENABLED(CONFIG_EFI_ARMSTUB_DTB_LOADER) ||
secure_boot != efi_secureboot_mode_disabled) {
if (!IS_ENABLED(CONFIG_EFI_ARMSTUB_DTB_LOADER)) {
if (strstr(cmdline_ptr, "dtb="))
efi_err("Ignoring DTB from command line.\n");
} else {
Expand Down

0 comments on commit 93f4636

Please sign in to comment.