Skip to content
Snippets Groups Projects
Commit 09a5422f authored by minute's avatar minute
Browse files

Merge branch 'mmdebstrap' into 'master'

RC1 of MNT Reform System Image and Rescue Image

See merge request reform/reform-system-image!12
parents 25228563 9c962239
Branches
Tags reform2-rc1
No related merge requests found
Showing
with 5835 additions and 146 deletions
#!/bin/bash
set -x
set -e
./mkdeps.sh
./mkkernel.sh
./mkuboot.sh
mkdir -p target
mkdir -p target-userland
# DEPS: parted multistrap udisksctl g++-arm-linux-gnueabihf
# change 4000 below to the number of megabytes your image file should have
if [ ! -f reform-system.img ]; then
dd if=/dev/zero of=reform-system.img bs=1M count=8000
else
echo "reform-system.img already exists. Delete it if you want to change the image size."
fi
# can/should we use non-mbr? GPT?
/sbin/parted -s reform-system.img "mklabel msdos"
/sbin/parted -s reform-system.img "mkpart primary ext4 1 -1"
/sbin/parted -s reform-system.img print
LOOPDISK=$(udisksctl loop-setup -f ./reform-system.img)
LOOPDISK=$(echo $LOOPDISK | cut -f 5 -d " " | tr -d .)
echo LOOPDISK: $LOOPDISK
# format the partition
echo "About to format ${LOOPDISK}p1!"
read -p "Are you sure? " -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]
then
sudo /sbin/mkfs.ext4 -q ${LOOPDISK}p1
else
exit 1
fi
# print the finished partition table
/sbin/parted -s reform-system.img print
sudo mount -t ext4 ${LOOPDISK}p1 target
# create debian userland
sudo /usr/sbin/multistrap -d target-userland -f multistrap.conf
sudo cp target-userland/usr/share/base-passwd/group.master target-userland/etc/group
sudo cp etc-templates/passwd target-userland/etc/passwd
sudo cp etc-templates/inittab target-userland/etc
sudo cp etc-templates/shadow target-userland/etc
sudo cp etc-templates/fstab target-userland/etc
sudo cp etc-templates/hosts target-userland/etc
sudo cp etc-templates/resolv.conf target-userland/etc
sudo mkdir -p target-userland/etc/dhcp
sudo cp etc-templates/dhclient.conf target-userland/etc/dhcp
sudo cp etc-templates/network-interfaces target-userland/etc/network/interfaces
sudo cp etc-templates/motd target-userland/etc
sudo cp etc-templates/hostname target-userland/etc
sudo cp etc-templates/common-* target-userland/etc/pam.d
sudo chown root:root -R target-userland/bin target-userland/usr target-userland/sbin target-userland/lib target-userland/sys target-userland/etc target-userland/var target-userland/root
sudo chown root:shadow target-userland/etc/shadow
sudo cp target-scripts/* target-userland/root/
sudo cp target-scripts/.bash_profile target-userland/root/
sudo cp reform/reformd/reformd.sh target-userland/root/
# X startup config
sudo cp target-scripts/.xinitrc target-userland/root/
# i3 default config
sudo mkdir -p target-userland/root/.config/i3
sudo cp etc-templates/i3_config target-userland/root/.config/i3/config
sudo cp etc-templates/i3status.conf target-userland/root/.config/
# Reform sources
sudo cp -Rv reform target-userland/root/
# inception!
sudo mkdir -p target-userland/root/sources
sudo cp -Rv reform target-userland/root/sources/
sudo cp -Rv reform-linux target-userland/root/sources/
sudo cp -Rv reform-userland-src target-userland/root/sources/
sudo cp -Rv pdfs target-userland/root/
sudo mv target-userland/root/reformd-init-script.sh target-userland/etc/init.d/reformd
sudo cp etc-templates/xorg.conf target-userland/etc/X11
sudo mkdir -p target-userland/var/local/log
# extract /usr/local tree
sudo tar --directory ./target-userland -xf reform-usrlocal.tar.gz -v -z
# install debian userland in image
sudo cp -av target-userland/* target/
# install the manpage
sudo mkdir -p target/usr/local/share/man/man1
sudo cp reform/handbook/build/man/reform.1 target/usr/local/share/man/man1
# install custom kernel
# mkkernel.sh needs to run before. this creates zImage and imx6qp-mntreform.dtb.
sudo cp linux/arch/arm/boot/zImage target
sudo cp linux/arch/arm/boot/dts/imx6qp-mntreform.dtb target
sudo cp mnt-blk-icon.bmp target
# install custom u-boot
# mkuboot.sh needs to run before. this creates u-boot.imx.
sudo umount target
# install u-boot
sudo dd if=./u-boot/u-boot.imx of=$LOOPDISK bs=1k seek=1
# detach the image
sudo udisksctl loop-delete -b $LOOPDISK
echo Reform system image created: reform-system.img
#!/bin/sh
set -x
set -e
cd u-boot
cp mntreform-config .config
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf-
make -j4
cd ..
[General]
arch=armhf
noauth=false
unpack=true
debootstrap=Debian
aptsources=Debian
allowrecommends=false
[Debian]
packages=adduser apt apt-utils apt-file apt-listbugs bsdmainutils procps gpgv debian-archive-keyring readline-common gnupg cpio init-system-helpers cron netbase groff-base iproute2 ifupdown isc-dhcp-common isc-dhcp-client iptables iputils-ping kmod less logrotate man-db manpages nano net-tools netcat-traditional nfacct rsyslog tasksel-data tasksel traceroute vim-common vim emacs wget whiptail ssh wicd-curses wicd-gtk wpasupplicant zsh htop build-essential sysvinit-core xterm elinks ntpdate ntp lm-sensors usbutils fbset screen brightnessctl curl coreutils xorg i3 i3status i3lock dmenu py3status alsa-utils sudo ca-certificates parted file locales git make ed mesa-utils console-setup console-data unicode-data unifont ttf-unifont kbd kmscube gpm openbox mplayer apulse pciutils gparted grafx2 minetest mupdf lxappearance faenza-icon-theme pcmanfm cryptsetup meshlab libgtk-3-0 libvte-2.91-0 firefox usb-modeswitch wvdial pmount sakura obconf openbox-menu wicd-gtk tint2 compton unzip gtk2-engines gdb telnet sxiv kicad inkscape gimp slic3r gedit gnumeric vim-gtk3 claws-mail netsurf-gtk irssi busybox libllvm6.0 strace bc milkytracker dfu-programmer gcc-avr binutils-avr avrdude arduino-mk zathura
source=http://http.debian.net/debian
keyring=debian-archive-keyring
suite=sid
omitdebsrc=false
additional=
reinstall=
components=main contrib non-free
From f778a2885212d58c462786984bc17eaf6b5d42d7 Mon Sep 17 00:00:00 2001
From: Sean Cross <xobs@kosagi.com>
Date: Fri, 1 Jan 2016 16:20:26 +0800
Subject: [PATCH 17/65] pci: fix suspend on i.MX6
Signed-off-by: Sean Cross <xobs@kosagi.com>
---
arch/arm/mach-imx/pm-imx6.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c
index 4470376..7915ff9 100644
--- a/arch/arm/mach-imx/pm-imx6.c
+++ b/arch/arm/mach-imx/pm-imx6.c
@@ -364,6 +364,8 @@ static int imx6q_suspend_finish(unsigned long val)
static int imx6q_pm_enter(suspend_state_t state)
{
+ struct regmap *g;
+
switch (state) {
case PM_SUSPEND_STANDBY:
imx6_set_lpm(STOP_POWER_ON);
@@ -390,10 +392,39 @@ static int imx6q_pm_enter(suspend_state_t state)
imx6_enable_rbc(true);
imx_gpc_pre_suspend(true);
imx_anatop_pre_suspend();
+
+ /*
+ * L2 can exit by 'reset' or Inband beacon (from remote EP)
+ * toggling phy_powerdown has same effect as 'inband beacon'
+ * So, toggle bit18 of GPR1, used as a workaround of errata
+ * "PCIe PCIe does not support L2 Power Down"
+ */
+ if (IS_ENABLED(CONFIG_PCI_IMX6)) {
+ g = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr");
+ if (IS_ERR(g)) {
+ pr_err("failed to find fsl,imx6q-iomux-gpr regmap\n");
+ return PTR_ERR(g);
+ }
+ regmap_update_bits(g, IOMUXC_GPR1, IMX6Q_GPR1_PCIE_TEST_PD,
+ IMX6Q_GPR1_PCIE_TEST_PD);
+ }
+
/* Zzz ... */
cpu_suspend(0, imx6q_suspend_finish);
if (cpu_is_imx6q() || cpu_is_imx6dl())
imx_smp_prepare();
+
+ /*
+ * L2 can exit by 'reset' or Inband beacon (from remote EP)
+ * toggling phy_powerdown has same effect as 'inband beacon'
+ * So, toggle bit18 of GPR1, used as a workaround of errata
+ * "PCIe PCIe does not support L2 Power Down"
+ */
+ if (IS_ENABLED(CONFIG_PCI_IMX6)) {
+ regmap_update_bits(g, IOMUXC_GPR1, IMX6Q_GPR1_PCIE_TEST_PD,
+ !IMX6Q_GPR1_PCIE_TEST_PD);
+ }
+
imx_anatop_post_resume();
imx_gpc_post_resume();
imx6_enable_rbc(false);
--
2.7.3
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 130da5195f3..caf95fba41f 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -1890,6 +1890,8 @@ int drm_atomic_helper_setup_commit(struct drm_atomic_state *state,
continue;
}
+ complete_all(&commit->flip_done);
+
if (!new_crtc_state->event) {
commit->event = kzalloc(sizeof(*commit->event),
GFP_KERNEL);
/*
* Copyright 2018 MNT Media and Technology UG.
*
* This file is dual-licensed: you can use it either under the terms
* of the GPL or the X11 license, at your option. Note that this dual
* licensing only applies to this file, and not this project as a
* whole.
*
* a) This file is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* This file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* Or, alternatively,
*
* b) Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
chosen {
stdout-path = &uart1;
};
memory {
reg = <0x10000000 0xf0000000>;
};
regulators {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <0>;
reg_usb_otg_vbus: regulator@0 {
compatible = "regulator-fixed";
reg = <0>;
regulator-name = "usb_otg_vbus";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
regulator-always-on;
enable-active-high;
};
reg_usb_h1_vbus: regulator@1 {
compatible = "regulator-fixed";
reg = <1>;
regulator-name = "usb_h1_vbus";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
regulator-always-on;
enable-active-high;
};
reg_1p5v: regulator@2 {
compatible = "regulator-fixed";
reg = <2>;
regulator-name = "1P5V";
regulator-min-microvolt = <1500000>;
regulator-max-microvolt = <1500000>;
regulator-always-on;
};
reg_2p5v: regulator@3 {
compatible = "regulator-fixed";
reg = <3>;
regulator-name = "2P5V";
regulator-min-microvolt = <2500000>;
regulator-max-microvolt = <2500000>;
regulator-always-on;
};
reg_3p3v: regulator@4 {
compatible = "regulator-fixed";
reg = <4>;
regulator-name = "3P3V";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
};
};
leds {
compatible = "gpio-leds";
};
sound {
compatible = "fsl,sgtl5000",
"fsl,imx-audio-sgtl5000";
model = "imx6qp-mntreform-sgtl5000";
ssi-controller = <&ssi1>;
audio-codec = <&codec>;
audio-routing =
"MIC_IN", "Mic Jack",
"Mic Jack", "Mic Bias",
"Headphone Jack", "HP_OUT";
//micbias-resistor-k-ohms = <2>;
//micbias-voltage-m-volts = <2250>;
//clocks = <&clks 150>;
mux-int-port = <1>;
mux-ext-port = <4>;
lrclk-strength = <3>;
};
backlight_lvds0: backlight-lvds0 {
compatible = "pwm-backlight";
pwms = <&pwm1 0 5000000>;
brightness-levels = <0 4 8 16 32 64 128 255>;
default-brightness-level = <4>;
power-supply = <&reg_3p3v>;
status = "okay";
};
};
&audmux {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_audmux>;
status = "okay";
};
/*
The following clocks can be the parent of ldb_di_sel clock:
{ "pll5_video_div", "pll2_pfd0_352m", "pll2_pfd2_396m", "mmdc_ch1_axi", "pll3_usb_otg", };
See: https://community.nxp.com/thread/306801
*/
&clks {
assigned-clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>, <&clks IMX6QDL_CLK_LDB_DI1_SEL>;
assigned-clock-parents = <&clks IMX6QDL_CLK_PLL2_PFD2_396M>, <&clks IMX6QDL_CLK_PLL2_PFD2_396M>;
};
&ecspi1 {
cs-gpios = <&gpio3 19 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi1>;
status = "okay";
flash: m25p80@0 {
compatible = "microchip,sst25vf016b";
spi-max-frequency = <20000000>;
reg = <0>;
};
};
&fec {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_enet>;
phy-mode = "rgmii";
phy-reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>;
fsl,magic-packet;
status = "okay";
};
/*
* Copied from imx6q-utilite-pro.dts: forces HDMI to IPU2
*/
/delete-node/&ipu1_di0_hdmi;
/delete-node/&hdmi_mux_0;
/delete-node/&ipu1_di1_hdmi;
/delete-node/&hdmi_mux_1;
&hdmi {
ddc-i2c-bus = <&i2c1>;
status = "okay";
};
&i2c1 {
clock-frequency = <100000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c1>;
status = "okay";
};
&i2c2 {
clock-frequency = <100000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c2>;
status = "okay";
};
&i2c3 {
clock-frequency = <100000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c3>;
status = "okay";
codec: sgtl5000@0a {
compatible = "fsl,sgtl5000";
reg = <0x0a>;
clocks = <&clks IMX6QDL_CLK_CKO>;
VDDA-supply = <&reg_3p3v>;
VDDIO-supply = <&reg_3p3v>;
VDDD-supply = <&reg_1p5v>;
};
};
&iomuxc {
mntreform {
pinctrl_hog: hoggrp {
fsl,pins = <
MX6QDL_PAD_KEY_ROW4__GPIO4_IO15 0x80000000 /* USB0 Pwr */
MX6QDL_PAD_GPIO_4__GPIO1_IO04 0x80000000 /* USB1 Pwr */
// tinyrex stuff
MX6QDL_PAD_NANDF_CS2__GPIO6_IO15 0x80000000 /* CPU Gpio 0 */
MX6QDL_PAD_EIM_D22__GPIO3_IO22 0x80000000 /* CPU Gpio 1 */
>;
};
pinctrl_audmux: audmuxgrp {
fsl,pins = <
MX6QDL_PAD_SD2_DAT0__AUD4_RXD 0x130b0
MX6QDL_PAD_SD2_DAT3__AUD4_TXC 0x130b0
MX6QDL_PAD_SD2_DAT2__AUD4_TXD 0x110b0
MX6QDL_PAD_SD2_DAT1__AUD4_TXFS 0x130b0
MX6QDL_PAD_GPIO_0__CCM_CLKO1 0x130b0 /* AUD4_MCK */
>;
};
pinctrl_ecspi1: ecspi1grp {
fsl,pins = <
MX6QDL_PAD_EIM_D17__ECSPI1_MISO 0x100b1
MX6QDL_PAD_EIM_D18__ECSPI1_MOSI 0x100b1
MX6QDL_PAD_EIM_D16__ECSPI1_SCLK 0x100b1
MX6QDL_PAD_EIM_D19__GPIO3_IO19 0x000b1
>;
};
pinctrl_enet: enetgrp {
fsl,pins = <
MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x0001b0b0
MX6QDL_PAD_ENET_MDC__ENET_MDC 0x0001b0b0
MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x0001b0b0
MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x0001b0b0
MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x0001b0b0
MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x0001b0b0
MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x0001b0b0
MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x0001b0b0
MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x0001b0b0
MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x0001b0b0
MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x0001b0b0
MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x0001b0b0
MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x0001b0b0
MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x0001b0b0
MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x0001b0b0
MX6QDL_PAD_ENET_TX_EN__GPIO1_IO28 0x80000000 /* PHY Int */
MX6QDL_PAD_ENET_RXD1__GPIO1_IO26 0x80000000 /* PHY Int */
MX6QDL_PAD_ENET_CRS_DV__GPIO1_IO25 0x00000831 /* PHY Reset */
>;
};
pinctrl_i2c1: i2c1grp {
fsl,pins = <
MX6QDL_PAD_EIM_D21__I2C1_SCL 0x4001b8b1
MX6QDL_PAD_EIM_D28__I2C1_SDA 0x4001b8b1
>;
};
pinctrl_i2c2: i2c2grp {
fsl,pins = <
MX6QDL_PAD_KEY_COL3__I2C2_SCL 0x4001b8b1
MX6QDL_PAD_KEY_ROW3__I2C2_SDA 0x4001b8b1
>;
};
pinctrl_i2c3: i2c3grp {
fsl,pins = <
MX6QDL_PAD_GPIO_5__I2C3_SCL 0x4001b8b1
MX6QDL_PAD_GPIO_16__I2C3_SDA 0x4001b8b1
>;
};
pinctrl_pcie: pciegrp {
fsl,pins = <
MX6QDL_PAD_GPIO_17__GPIO7_IO12 0x80000000 /* Wake */
MX6QDL_PAD_EIM_A25__GPIO5_IO02 0x80000000 /* Reset */
>;
};
pinctrl_lvds: lvdsgrp {
fsl,pins = <
MX6QDL_PAD_GPIO_6__GPIO1_IO06 0x80000000 /* LVDS CABC */
MX6QDL_PAD_DISP0_DAT21__GPIO5_IO15 0x80000000 /* LVDS Pwm */
>;
};
pinctrl_pwm1: pwm1grp {
fsl,pins = <
MX6QDL_PAD_DISP0_DAT8__PWM1_OUT 0x0001b0b1
>;
};
pinctrl_pwm2: pwm2grp {
fsl,pins = <
MX6QDL_PAD_DISP0_DAT9__PWM2_OUT 0x0001b0b1
>;
};
pinctrl_pwm3: pwm3grp {
fsl,pins = <
MX6QDL_PAD_SD4_DAT1__PWM3_OUT 0x0001b0b1
>;
};
pinctrl_pwm4: pwm4grp {
fsl,pins = <
MX6QDL_PAD_SD4_DAT2__PWM4_OUT 0x0001b0b1
>;
};
pinctrl_uart1: uart1grp {
fsl,pins = <
MX6QDL_PAD_SD3_DAT7__UART1_TX_DATA 0x1b0b1
MX6QDL_PAD_SD3_DAT6__UART1_RX_DATA 0x1b0b1
>;
};
pinctrl_uart2: uart2grp {
fsl,pins = <
MX6QDL_PAD_SD3_DAT5__UART2_TX_DATA 0x1b0b1
MX6QDL_PAD_SD3_DAT4__UART2_RX_DATA 0x1b0b1
>;
};
pinctrl_usbotg: usbotggrp {
fsl,pins = <
MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x17059
>;
};
pinctrl_usdhc3: usdhc3grp {
fsl,pins = <
MX6QDL_PAD_SD3_CMD__SD3_CMD 0x00017059
MX6QDL_PAD_SD3_CLK__SD3_CLK 0x00010059
MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x00017059
MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x00017059
MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x00017059
MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x00017059
MX6QDL_PAD_SD3_RST__GPIO7_IO08 0x80000000 /* CD */
MX6QDL_PAD_NANDF_CS3__GPIO6_IO16 0x80000000 /* WP */
>;
};
};
};
&pcie {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pcie>;
reset-gpio = <&gpio5 2 0>;
status = "okay";
};
&sata {
status = "okay";
};
&pwm1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pwm1>;
status = "okay";
};
&pwm2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pwm2>;
status = "okay";
};
&pwm3 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pwm3>;
status = "okay";
};
&pwm4 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pwm4>;
status = "okay";
};
&ssi1 {
status = "okay";
};
&uart1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart1>;
status = "okay";
};
&uart2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart2>;
status = "okay";
};
&usbh1 {
vbus-supply = <&reg_usb_h1_vbus>;
status = "okay";
};
&usbotg {
vbus-supply = <&reg_usb_otg_vbus>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usbotg>;
disable-over-current;
srp-disable;
hnp-disable;
adp-disable;
status = "okay";
};
&usbphy1 {
tx-d-cal = <0x5>;
};
&usbphy2 {
tx-d-cal = <0x5>;
};
&usdhc3 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usdhc3>;
bus-width = <4>;
cd-gpios = <&gpio7 8 GPIO_ACTIVE_HIGH>;
wp-gpios = <&gpio6 16 GPIO_ACTIVE_LOW>;
non-removable;
no-1-8-v;
keep-power-in-suspend;
status = "okay";
//wp-inverted;
};
&ldb {
status = "okay";
lvds-channel@0 {
status = "ok";
fsl,data-width = <18>;
fsl,data-mapping = "spwg";
display-timings {
native-mode = <&timing0>;
timing0: 1366x768 {
clock-frequency = <70000000>;
hactive = <1368>; /* or fb0 doesn't work on imx-drm */
vactive = <768>;
hback-porch = <84>;
hfront-porch = <36>;
vback-porch = <14>;
vfront-porch = <3>;
hsync-len = <40>;
vsync-len = <5>;
};
};
};
};
/*
* Copyright 2018 MNT Media and Technology UG.
*
* This file is dual-licensed: you can use it either under the terms
* of the GPL or the X11 license, at your option. Note that this dual
* licensing only applies to this file, and not this project as a
* whole.
*
* a) This file is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* Or, alternatively,
*
* b) Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
/dts-v1/;
#include "imx6qp.dtsi"
#include "imx6qdl-mntreform.dtsi"
/ {
model = "MNT Reform 0.4";
compatible = "mnt,reform", "fsl,imx6qp";
};
This diff is collapsed.
File moved
linux-5.7-rc6.imx8mq-mnt-reform2.kernel
linux-5.7-rc6.tar.gz
linux-5.7-rc6
!linux-5.7-rc6/.config
!linux-5.7-rc6/arch/arm64/boot/dts/freescale/imx8mq-mnt-reform2.dts
!linux-5.7-rc6/arch/arm64/boot/dts/freescale/imx8mq.dtsi
linux/
target-userland/
u-boot/
reform-system.img
#!/bin/bash
for d in dev proc sys
do
umount -f target-userland/$d || echo "Umounting $d failed"
done
rm -rf target-userland
rm reform-system.img
#!/bin/bash
DISK=""
if [ -e /dev/loop0p1 ]
then
DISK="-drive if=none,file=/dev/loop0p1,id=rfs -device virtio-blk-device,drive=rfs"
else
echo "Hint: mount the disk image with: udisksctl loop-setup -f ./reform-system.img"
fi
qemu-system-aarch64 \
-machine virt \
-cpu cortex-a53 \
-smp 4 \
-kernel ./linux/arch/arm64/boot/Image \
-device virtio-gpu-pci,virgl=on \
-append "console=ttyAMA0 root=/dev/vda rw" \
-m 4096 \
-nic user,model=virtio-net-pci \
-display gtk,gl=on \
-device usb-ehci -device usb-kbd -device usb-tablet -usb \
-serial stdio \
$DISK
#!/bin/bash
# an example of how to flash the image to an SD card.
# be sure to select the correct of= device below!
# sudo dd if=reform-system.img of=/dev/sdc bs=8M status=progress
#!/bin/bash
set -x
set -e
# make sure build tools are installed
# tested with bare Ubuntu 20.04 server
sudo apt-get -y install parted multistrap udisks2 gcc-aarch64-linux-gnu make device-tree-compiler qemu-user-static binfmt-support build-essential bison flex libssl-dev mmdebstrap
# build the linux kernel
./mkkernel.sh
# build u-boot
./mkuboot.sh
# build the debian userland and configure it
sudo ./mkuserland.sh
# chroot into the userland and build custom packages (mesa, xserver...)
sudo ./mkuserland2.sh
# Rescue System ---------------------------------------------------------
SIZE=4096M
# create ext4 partition from target root directory directly at 4MiB offset
sudo /sbin/mke2fs -v -L 'MNTRESCUE' -N 0 -O 64bit -E offset=4194304 -d target-userland -m 5 -r 1 -t ext4 reform-rescue-system.img $SIZE
sudo /sbin/parted -s reform-rescue-system.img "mklabel msdos"
sudo /sbin/parted -s reform-rescue-system.img "mkpart primary ext4 4MiB -1s"
sudo /sbin/parted -s reform-rescue-system.img print
# mkuboot.sh needs to run before. this creates flash.bin.
# install u-boot for i.MX8MQ
sudo dd if=./u-boot/flash.bin of=reform-rescue-system.img conv=notrunc bs=1k seek=33
echo Reform Rescue System Image created: reform-rescue-system.img
# Full System -----------------------------------------------------------
# chroot into the userland and add extra applications
sudo ./mkuserland3.sh
SIZE=9000M
# create ext4 partition from target root directory directly at 4MiB offset
sudo /sbin/mke2fs -v -L 'MNTREFORM' -N 0 -O 64bit -E offset=4194304 -d target-userland -m 5 -r 1 -t ext4 reform-system.img $SIZE
sudo /sbin/parted -s reform-system.img "mklabel msdos"
sudo /sbin/parted -s reform-system.img "mkpart primary ext4 4MiB -1s"
sudo /sbin/parted -s reform-system.img print
# install u-boot for i.MX8MQ
sudo dd if=./u-boot/flash.bin of=reform-system.img conv=notrunc bs=1k seek=33
echo Reform Full System Image created: reform-system.img
#!/bin/bash
set -x
set -e
export ARCH=arm64
#export LOADADDR=0x40480000
export CROSS_COMPILE=aarch64-linux-gnu-
if [ ! -d linux ]
then
echo "Cloning Linux..."
mkdir linux
cd linux
git init
git remote add origin https://github.com/torvalds/linux.git
# temporary linux 5.11rc7 commit
git fetch --depth 1 origin e0756cfc7d7cd08c98a53b6009c091a3f6a50be6
git checkout FETCH_HEAD
cd ..
fi
cp ./template-kernel/*.dts ./linux/arch/arm64/boot/dts/freescale/
cp ./template-kernel/kernel-config ./linux/.config
cd linux
for PATCHFILE in ../template-kernel/patches/*.patch
do
echo PATCH: $PATCHFILE
if git apply --check $PATCHFILE; then
git apply $PATCHFILE
else
echo "\e[1mKernel patch already applied or cannot apply: $PATCHFILE"
fi
done
make -j$(nproc) Image freescale/imx8mq-mnt-reform2.dtb freescale/imx8mq-mnt-reform2-hdmi.dtb
cd ..
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment