Skip to content

ARCH_BCM2708 rpi-3.17.y and Device Tree #728

Closed

Description

@notro

The kernel command line (chosen/bootargs) isn't filled in by the firmware as it used to, it only contains the value from the dtb.
Has something changed?

Uncompressing Linux... done, booting the kernel.
[    0.000000] Booting Linux on physical CPU 0x0
[...]
[    0.000000] Machine model: Raspberry Pi
[...]
[    0.000000] Kernel command line: console=ttyAMA0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         [    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[...]
[    2.226990] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6

config.txt

device_tree=bcm2708-rpi-b.dtb
device_tree_address=0x100
kernel_address=0x8000
disable_commandline_tags=2

Using the contents of cmdline.txt in chosen/bootargs, makes it boot.

Activity

  1. notro commented on Nov 22, 2014

    @notro
    ContributorAuthor

    Here's the diff I need to get going. The framebuffer driver fails to load, so I had to#ifndef the dma stuff. I haven't got a HDMI monitor, so I haven't tried it.
    I can make a PR, but what do we do about fbdev?

    diff --git a/arch/arm/boot/dts/bcm2708-rpi-b.dts b/arch/arm/boot/dts/bcm2708-rpi-b.dts
    index 5893122..60c9fed 100644
    --- a/arch/arm/boot/dts/bcm2708-rpi-b.dts
    +++ b/arch/arm/boot/dts/bcm2708-rpi-b.dts
    @@ -62,3 +62,8 @@
        pinctrl-0 = <&i2c1_pins>;
        clock-frequency = <100000>;
     };
    +
    +&mmc {
    +   status = "okay";
    +   bus-width = <4>;
    +};
    diff --git a/arch/arm/boot/dts/bcm2708.dtsi b/arch/arm/boot/dts/bcm2708.dtsi
    index edf3619..504fbd3 100644
    --- a/arch/arm/boot/dts/bcm2708.dtsi
    +++ b/arch/arm/boot/dts/bcm2708.dtsi
    @@ -11,7 +11,7 @@
               bootargs must be 1024 characters long because the
               VC bootloader can't expand it
            */
    -       bootargs = "console=ttyAMA0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 ";
    +       bootargs = "dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait dyndbg=\"file dmaengine.c +p\"";
        };
    
        soc {
    @@ -20,6 +20,27 @@
            #size-cells = <1>;
            ranges = <0x7e000000 0x20000000 0x02000000>;
    
    +       dma: dma@7e007000 {
    +           compatible = "brcm,bcm2835-dma";
    +           reg = <0x7e007000 0xf00>;
    +           interrupts = <1 16>,
    +                    <1 17>,
    +                    <1 18>,
    +                    <1 19>,
    +                    <1 20>,
    +                    <1 21>,
    +                    <1 22>,
    +                    <1 23>,
    +                    <1 24>,
    +                    <1 25>,
    +                    <1 26>,
    +                    <1 27>,
    +                    <1 28>;
    +
    +           #dma-cells = <1>;
    +           brcm,dma-channel-mask = <0x7f35>;
    +       };
    +
            intc: interrupt-controller {
                compatible = "brcm,bcm2708-armctrl-ic";
                reg = <0x7e00b200 0x200>;
    @@ -34,6 +55,17 @@
                #gpio-cells = <2>;
            };
    
    +       mmc: mmc@7e300000 {
    +           compatible = "brcm,bcm2835-mmc";
    +           reg = <0x7e300000 0x100>;
    +           interrupts = <2 30>;
    +           clocks = <&clk_mmc>;
    +           dmas = <&dma 5>,
    +                  <&dma 5>;
    +           dma-names = "tx", "rx";
    +           status = "disabled";
    +       };
    +
            spi0: spi@7e204000 {
                compatible = "brcm,bcm2708-spi";
                reg = <0x7e204000 0x1000>;
    @@ -70,6 +102,14 @@
            #address-cells = <1>;
            #size-cells = <0>;
    
    +       clk_mmc: clock@0 {
    +           compatible = "fixed-clock";
    +           reg = <0>;
    +           #clock-cells = <0>;
    +           clock-output-names = "mmc";
    +           clock-frequency = <250000000>;
    +       };
    +
            clk_i2c: i2c {
                compatible = "fixed-clock";
                reg = <1>;
    diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c
    index 2f2e11f..faf1e33 100644
    --- a/arch/arm/mach-bcm2708/bcm2708.c
    +++ b/arch/arm/mach-bcm2708/bcm2708.c
    @@ -834,7 +834,7 @@ void __init bcm2708_init(void)
        bcm2708_init_clocks();
        bcm2708_dt_init();
    
    -   bcm_register_device(&bcm2708_dmaman_device);
    +   bcm_register_device_dt(&bcm2708_dmaman_device);
        bcm_register_device(&bcm2708_vcio_device);
     #ifdef CONFIG_BCM2708_GPIO
        bcm_register_device(&bcm2708_gpio_device);
    @@ -851,7 +851,7 @@ void __init bcm2708_init(void)
        bcm_register_device(&bcm2708_powerman_device);
    
     #ifdef CONFIG_MMC_BCM2835
    -   bcm_register_device(&bcm2835_emmc_device);
    +   bcm_register_device_dt(&bcm2835_emmc_device);
     #endif
        bcm2708_init_led();
        for (i = 0; i < ARRAY_SIZE(bcm2708_alsa_devices); i++)
    diff --git a/drivers/pinctrl/pinctrl-bcm2708.c b/drivers/pinctrl/pinctrl-bcm2708.c
    index 40d9c86..b0995fd 100644
    --- a/drivers/pinctrl/pinctrl-bcm2708.c
    +++ b/drivers/pinctrl/pinctrl-bcm2708.c
    @@ -577,16 +577,6 @@ static int bcm2708_pmx_enable(struct pinctrl_dev *pctldev,
        return 0;
     }
    
    -static void bcm2708_pmx_disable(struct pinctrl_dev *pctldev,
    -       unsigned func_selector,
    -       unsigned group_selector)
    -{
    -   struct bcm2708_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev);
    -
    -   /* disable by setting to GPIO_IN */
    -   bcm2708_pinctrl_fsel_set(pc, group_selector, BCM2708_FSEL_GPIO_IN);
    -}
    -
     static void bcm2708_pmx_gpio_disable_free(struct pinctrl_dev *pctldev,
            struct pinctrl_gpio_range *range,
            unsigned offset)
    @@ -616,7 +606,6 @@ static const struct pinmux_ops bcm2708_pmx_ops = {
        .get_function_name = bcm2708_pmx_get_function_name,
        .get_function_groups = bcm2708_pmx_get_function_groups,
        .enable = bcm2708_pmx_enable,
    -   .disable = bcm2708_pmx_disable,
        .gpio_disable_free = bcm2708_pmx_gpio_disable_free,
        .gpio_set_direction = bcm2708_pmx_gpio_set_direction,
     };
    diff --git a/drivers/video/fbdev/bcm2708_fb.c b/drivers/video/fbdev/bcm2708_fb.c
    index 32aaaf5..1c706cca 100644
    --- a/drivers/video/fbdev/bcm2708_fb.c
    +++ b/drivers/video/fbdev/bcm2708_fb.c
    @@ -470,6 +470,7 @@ static void set_dma_cb(struct bcm2708_dma_cb *cb,
        cb->pad[1] = 0;
     }
    
    +#ifndef CONFIG_OF
     static void bcm2708_fb_copyarea(struct fb_info *info,
                    const struct fb_copyarea *region)
     {
    @@ -587,6 +588,15 @@ static void bcm2708_fb_copyarea(struct fb_info *info,
        }
        fb->stats.dma_copies++;
     }
    +#else
    +static void bcm2708_fb_copyarea(struct fb_info *info,
    +               const struct fb_copyarea *region)
    +{
    +   cfb_copyarea(info, region);
    +
    +   return;
    +}
    +#endif
    
     static void bcm2708_fb_imageblit(struct fb_info *info,
                     const struct fb_image *image)
    @@ -711,6 +721,7 @@ static int bcm2708_fb_probe(struct platform_device *dev)
    
        bcm2708_fb_debugfs_init(fb);
    
    +#ifndef CONFIG_OF
        fb->cb_base = dma_alloc_writecombine(&dev->dev, SZ_64K,
                             &fb->cb_handle, GFP_KERNEL);
        if (!fb->cb_base) {
    @@ -740,6 +751,7 @@ static int bcm2708_fb_probe(struct platform_device *dev)
    
        pr_info("BCM2708FB: allocated DMA channel %d @ %p\n",
               fb->dma_chan, fb->dma_chan_base);
    +#endif
    
        fb->dev = dev;
    
  2. brycejacobs commented on Nov 22, 2014

    @brycejacobs

    I can attempt to patch it and plug in to see if HDMI works. Does the .dts or .dtsi need to be modified any to account for HDMI hookup?

  3. popcornmix commented on Nov 22, 2014

    @popcornmix
    Collaborator

    My colleague @pelwell has been working on 3.17 with DT support and I believe all drivers (including framebuffer) are working for him with some local mods that will be pushed out soon.

    He did mention these were the main changes:

    1. Remove the BUG() in bcm2708_dt_init() for the case where of_platform_populate() fails.

    2. In drivers/of/fdt.c:

       static int __init of_flat_dt_debugfs_export_fdt(void)
       {
      -       struct dentry *d = debugfs_create_dir("device-tree", NULL);
      +       struct dentry *d;
    
      +       if (!initial_boot_params)
      +               return -ENOENT;
      +
      +       d = debugfs_create_dir("device-tree", NULL);
    
    1. In drivers/dma/bcm2708-dmaengine.c and drivers/mmc/host/bcm2835-mmc.c, replace the use of CONFIG_OF as a predicate with CONFIG_ARCH_BCM2835.
  4. notro commented on Nov 23, 2014

    @notro
    ContributorAuthor

    Ok, I'll wait

  5. popcornmix commented on Dec 2, 2014

    @popcornmix
    Collaborator

    We've pushed some changes to 3.17.y tree and pushed a BRANCH=next firmware. See:
    http://www.raspberrypi.org/forums/viewtopic.php?f=29&t=93015

    So, foundation bcm2708 3.17 tree works with device tree enabled, using bcmrpi_defconfig with CONFIG_BCM2708_DT=y added.

    Can you report if you still have problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions