| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (c) 2011-2016 Zhang, Keguang <keguang.zhang@gmail.com> |
|---|
| 3 | | - * |
|---|
| 4 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 5 | | - * under the terms of the GNU General Public License as published by the |
|---|
| 6 | | - * Free Software Foundation; either version 2 of the License, or (at your |
|---|
| 7 | | - * option) any later version. |
|---|
| 8 | 4 | */ |
|---|
| 9 | 5 | |
|---|
| 10 | 6 | #include <linux/leds.h> |
|---|
| .. | .. |
|---|
| 15 | 11 | #include <dma.h> |
|---|
| 16 | 12 | #include <nand.h> |
|---|
| 17 | 13 | #include <platform.h> |
|---|
| 18 | | - |
|---|
| 19 | | -struct plat_ls1x_dma ls1x_dma_pdata = { |
|---|
| 20 | | - .nr_channels = 3, |
|---|
| 21 | | -}; |
|---|
| 22 | | - |
|---|
| 23 | | -static struct mtd_partition ls1x_nand_parts[] = { |
|---|
| 24 | | - { |
|---|
| 25 | | - .name = "kernel", |
|---|
| 26 | | - .offset = 0, |
|---|
| 27 | | - .size = SZ_16M, |
|---|
| 28 | | - }, |
|---|
| 29 | | - { |
|---|
| 30 | | - .name = "rootfs", |
|---|
| 31 | | - .offset = MTDPART_OFS_APPEND, |
|---|
| 32 | | - .size = MTDPART_SIZ_FULL, |
|---|
| 33 | | - }, |
|---|
| 34 | | -}; |
|---|
| 35 | | - |
|---|
| 36 | | -struct plat_ls1x_nand ls1x_nand_pdata = { |
|---|
| 37 | | - .parts = ls1x_nand_parts, |
|---|
| 38 | | - .nr_parts = ARRAY_SIZE(ls1x_nand_parts), |
|---|
| 39 | | - .hold_cycle = 0x2, |
|---|
| 40 | | - .wait_cycle = 0xc, |
|---|
| 41 | | -}; |
|---|
| 42 | 14 | |
|---|
| 43 | 15 | static const struct gpio_led ls1x_gpio_leds[] __initconst = { |
|---|
| 44 | 16 | { |
|---|
| .. | .. |
|---|
| 64 | 36 | static struct platform_device *ls1b_platform_devices[] __initdata = { |
|---|
| 65 | 37 | &ls1x_uart_pdev, |
|---|
| 66 | 38 | &ls1x_cpufreq_pdev, |
|---|
| 67 | | - &ls1x_dma_pdev, |
|---|
| 68 | 39 | &ls1x_eth0_pdev, |
|---|
| 69 | 40 | &ls1x_eth1_pdev, |
|---|
| 70 | 41 | &ls1x_ehci_pdev, |
|---|
| 71 | 42 | &ls1x_gpio0_pdev, |
|---|
| 72 | 43 | &ls1x_gpio1_pdev, |
|---|
| 73 | | - &ls1x_nand_pdev, |
|---|
| 74 | 44 | &ls1x_rtc_pdev, |
|---|
| 75 | 45 | &ls1x_wdt_pdev, |
|---|
| 76 | 46 | }; |
|---|
| .. | .. |
|---|
| 78 | 48 | static int __init ls1b_platform_init(void) |
|---|
| 79 | 49 | { |
|---|
| 80 | 50 | ls1x_serial_set_uartclk(&ls1x_uart_pdev); |
|---|
| 81 | | - ls1x_dma_set_platdata(&ls1x_dma_pdata); |
|---|
| 82 | | - ls1x_nand_set_platdata(&ls1x_nand_pdata); |
|---|
| 83 | 51 | |
|---|
| 84 | 52 | gpio_led_register_device(-1, &ls1x_led_pdata); |
|---|
| 85 | 53 | |
|---|