Skip to content

Commit 3faaf7a

Browse files
author
Sebastien Bourdeauducq
committedMay 22, 2012
new time/early_printk/uart drivers compiling, untested
1 parent aa07145 commit 3faaf7a

File tree

8 files changed

+122
-238
lines changed

8 files changed

+122
-238
lines changed
 

‎arch/lm32/Kconfig.cpu

+2-4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ config CPU_MICO32
2020
bool "mico32"
2121
help
2222
LatticeMico32 processor.
23+
2324
endchoice
2425

2526
choice
@@ -29,15 +30,12 @@ choice
2930
config BOARD_MILKYMIST_ONE
3031
bool "Milkymist One"
3132

32-
config BOARD_MILKYMIST_SOC
33-
bool "Milkymist SoC"
3433
endchoice
3534
endif
3635

3736
config CPU_CLOCK
3837
int "CPU Clock [Hz] (integer)"
39-
default "80000000" if BOARD_MILKYMIST_ONE
40-
default "100000000" if BOARD_MILKYMIST_SOC
38+
default "83333333" if BOARD_MILKYMIST_ONE
4139

4240
config KERNEL_BASE_ADDR
4341
hex "Physical address where Linux Kernel is"

‎arch/lm32/boot/dts/milkymist_one.dts

+15-27
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
device_type = "cpu";
2424
compatible = "lattice,mico32";
2525
reg = <0>;
26-
clock-frequency = <80000000>; /* 80 MHz */
26+
clock-frequency = <83333333>;
2727
i-cache-line-size = <16>;
2828
d-cache-line-size = <16>;
2929
i-cache-size = <4096>;
@@ -43,46 +43,34 @@
4343
reg = <0x40000000 0x08000000>; /* 128MB */
4444
};
4545

46-
flash@0 {
47-
compatible = "cfi-flash";
48-
reg = <0x80000000 0x02000000>; /* 32MB */
49-
bank-width = <4>;
50-
device-width = <1>;
51-
#address-cells = <1>;
52-
#size-cells = <1>;
53-
partition@0 {
54-
label = "bitstream";
55-
reg = <0x00000000 0x00180000>;
56-
read-only;
57-
};
58-
partition@180000 {
59-
label = "unused";
60-
reg = <0x000a0000 0x02360000>;
61-
read-only;
62-
};
63-
};
64-
6546
csr-bus@e0000000 {
6647
#address-cells = <1>;
6748
#size-cells = <1>;
6849
ranges = <0x0 0xe0000000 0x100000>;
6950
compatible = "milkymist,csr-bus";
7051

71-
uart@0 {
52+
uart@0000 {
7253
device_type = "serial";
7354
compatible = "milkymist,uart";
74-
clock-frequency = <80000000>;
75-
reg = <0x0 0x1000>;
55+
clock-frequency = <83333333>;
56+
reg = <0x0000 0x800>;
7657
interrupts = <0>;
7758
interrupt-parent = <&pic>;
7859
};
60+
61+
timer@1800 {
62+
compatible = "milkymist,timer";
63+
reg = <0x1800 0x800>;
64+
interrupts = <1>;
65+
interrupt-parent = <&pic>;
66+
};
7967

80-
ethernet@8000 {
68+
ethernet@2000 {
8169
#address-cells = <1>;
8270
#size-cells = <0>;
83-
compatible = "milkymist,minimac2";
84-
reg = <0x8000 0x1000>;
85-
interrupts = <10 11>;
71+
compatible = "milkymist,minimac3";
72+
reg = <0x2000 0x800>;
73+
interrupts = <2>;
8674
interrupt-parent = <&pic>;
8775

8876
phy0: ethernet-phy@0 {

‎arch/lm32/defconfig

+8-77
Original file line numberDiff line numberDiff line change
@@ -161,19 +161,18 @@ CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
161161
CONFIG_PLAT_MILKYMIST=y
162162
CONFIG_CPU_MICO32=y
163163
CONFIG_BOARD_MILKYMIST_ONE=y
164-
# CONFIG_BOARD_MILKYMIST_SOC is not set
165-
CONFIG_CPU_CLOCK=80000000
164+
CONFIG_CPU_CLOCK=83333333
166165
CONFIG_KERNEL_BASE_ADDR=0x40000000
167-
# CONFIG_EARLY_PRINTK is not set
166+
CONFIG_EARLY_PRINTK=y
168167
# CONFIG_LM32_HW_JTAG is not set
169168
# CONFIG_NO_HZ is not set
170169
# CONFIG_HIGH_RES_TIMERS is not set
171170
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
172-
# CONFIG_HZ_100 is not set
173-
CONFIG_HZ_250=y
171+
CONFIG_HZ_100=y
172+
# CONFIG_HZ_250 is not set
174173
# CONFIG_HZ_300 is not set
175174
# CONFIG_HZ_1000 is not set
176-
CONFIG_HZ=250
175+
CONFIG_HZ=100
177176
# CONFIG_SCHED_HRTICK is not set
178177
CONFIG_FLATMEM_MANUAL=y
179178
CONFIG_HAVE_MEMBLOCK=y
@@ -250,7 +249,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
250249
# CONFIG_ATM is not set
251250
# CONFIG_L2TP is not set
252251
# CONFIG_BRIDGE is not set
253-
# CONFIG_NET_DSA is not set
254252
# CONFIG_VLAN_8021Q is not set
255253
# CONFIG_DECNET is not set
256254
# CONFIG_LLC2 is not set
@@ -313,8 +311,6 @@ CONFIG_OF_ADDRESS=y
313311
CONFIG_OF_IRQ=y
314312
CONFIG_OF_DEVICE=y
315313
CONFIG_OF_GPIO=y
316-
CONFIG_OF_NET=y
317-
CONFIG_OF_MDIO=y
318314
# CONFIG_PARPORT is not set
319315
CONFIG_BLK_DEV=y
320316
# CONFIG_BLK_DEV_COW_COMMON is not set
@@ -346,66 +342,7 @@ CONFIG_SCSI_MOD=y
346342
# CONFIG_SCSI_NETLINK is not set
347343
# CONFIG_ATA is not set
348344
# CONFIG_MD is not set
349-
CONFIG_NETDEVICES=y
350-
# CONFIG_DUMMY is not set
351-
# CONFIG_BONDING is not set
352-
# CONFIG_MACVLAN is not set
353-
# CONFIG_EQUALIZER is not set
354-
# CONFIG_TUN is not set
355-
# CONFIG_VETH is not set
356-
# CONFIG_MII is not set
357-
CONFIG_PHYLIB=y
358-
359-
#
360-
# MII PHY device drivers
361-
#
362-
CONFIG_MARVELL_PHY=y
363-
# CONFIG_DAVICOM_PHY is not set
364-
# CONFIG_QSEMI_PHY is not set
365-
# CONFIG_LXT_PHY is not set
366-
# CONFIG_CICADA_PHY is not set
367-
# CONFIG_VITESSE_PHY is not set
368-
# CONFIG_SMSC_PHY is not set
369-
# CONFIG_BROADCOM_PHY is not set
370-
# CONFIG_ICPLUS_PHY is not set
371-
# CONFIG_REALTEK_PHY is not set
372-
# CONFIG_NATIONAL_PHY is not set
373-
# CONFIG_STE10XP is not set
374-
# CONFIG_LSI_ET1011C_PHY is not set
375-
CONFIG_MICREL_PHY=y
376-
# CONFIG_FIXED_PHY is not set
377-
CONFIG_MDIO_BITBANG=y
378-
# CONFIG_MDIO_GPIO is not set
379-
# CONFIG_NET_ETHERNET is not set
380-
# CONFIG_NETDEV_1000 is not set
381-
# CONFIG_NETDEV_10000 is not set
382-
# CONFIG_WLAN is not set
383-
384-
#
385-
# Enable WiMAX (Networking options) to see the WiMAX drivers
386-
#
387-
# CONFIG_WAN is not set
388-
389-
#
390-
# CAIF transport drivers
391-
#
392-
CONFIG_PPP=y
393-
# CONFIG_PPP_MULTILINK is not set
394-
# CONFIG_PPP_FILTER is not set
395-
CONFIG_PPP_ASYNC=y
396-
CONFIG_PPP_SYNC_TTY=y
397-
CONFIG_PPP_DEFLATE=y
398-
CONFIG_PPP_BSDCOMP=y
399-
# CONFIG_PPP_MPPE is not set
400-
# CONFIG_PPPOE is not set
401-
CONFIG_SLIP=y
402-
CONFIG_SLIP_COMPRESSED=y
403-
CONFIG_SLHC=y
404-
# CONFIG_SLIP_SMART is not set
405-
# CONFIG_SLIP_MODE_SLIP6 is not set
406-
# CONFIG_NETCONSOLE is not set
407-
# CONFIG_NETPOLL is not set
408-
# CONFIG_NET_POLL_CONTROLLER is not set
345+
# CONFIG_NETDEVICES is not set
409346
# CONFIG_ISDN is not set
410347
# CONFIG_PHONE is not set
411348

@@ -555,12 +492,7 @@ CONFIG_GPIOLIB=y
555492
# CONFIG_HWMON is not set
556493
# CONFIG_THERMAL is not set
557494
# CONFIG_WATCHDOG is not set
558-
CONFIG_MFD_SUPPORT=y
559-
# CONFIG_MFD_CORE is not set
560-
# CONFIG_MFD_SM501 is not set
561-
# CONFIG_HTC_PASIC3 is not set
562-
# CONFIG_MFD_TMIO is not set
563-
# CONFIG_ABX500_CORE is not set
495+
# CONFIG_MFD_SUPPORT is not set
564496
# CONFIG_REGULATOR is not set
565497
# CONFIG_MEDIA_SUPPORT is not set
566498

@@ -597,7 +529,7 @@ CONFIG_DUMMY_CONSOLE=y
597529
#
598530
# CONFIG_VIRTIO_BALLOON is not set
599531
# CONFIG_STAGING is not set
600-
CONFIG_IOMMU_SUPPORT=y
532+
# CONFIG_IOMMU_SUPPORT is not set
601533
# CONFIG_VIRT_DRIVERS is not set
602534

603535
#
@@ -893,7 +825,6 @@ CONFIG_CRC32=y
893825
# CONFIG_LIBCRC32C is not set
894826
# CONFIG_CRC8 is not set
895827
CONFIG_ZLIB_INFLATE=y
896-
CONFIG_ZLIB_DEFLATE=y
897828
# CONFIG_XZ_DEC is not set
898829
# CONFIG_XZ_DEC_BCJ is not set
899830
CONFIG_DECOMPRESS_GZIP=y

‎arch/lm32/kernel/process.c

+3-5
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
#include <asm/traps.h>
4747
#include <asm/setup.h>
4848
#include <asm/pgtable.h>
49-
#include <asm/hw/milkymist.h>
5049

5150
asmlinkage void ret_from_fork(void);
5251
asmlinkage void syscall_tail(void);
@@ -93,9 +92,9 @@ void cpu_idle(void)
9392

9493
void machine_restart(char * __unused)
9594
{
96-
/* Writing to CSR_SYSTEM_ID causes a system reset */
97-
iowrite32be(1, CSR_SYSTEM_ID);
98-
while(1);
95+
printk("%s:%d: machine_restart() is not possible on lm32\n", __FILE__, __LINE__);
96+
for (;;)
97+
cpu_relax();
9998
}
10099

101100
void machine_halt(void)
@@ -259,4 +258,3 @@ void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long usp)
259258

260259
/*printk("start_thread: current=%lx usp=%lx\n", current, usp);*/
261260
}
262-

‎arch/lm32/platforms/milkymist/early_printk.c

+4-15
Original file line numberDiff line numberDiff line change
@@ -36,26 +36,15 @@
3636
#include <asm/irq.h>
3737
#include <linux/io.h>
3838

39-
#define UART_RXTX (void*)0xe0000000
40-
#define UART_DIVISOR (void*)0xe0000004
41-
#define UART_STAT (void*)0xe0000008
42-
#define UART_CTRL (void*)0xe000000c
43-
#define UART_DEBUG (void*)0xe000000c
39+
#define UART_RXTX ((void *)0xe0000000)
40+
#define UART_STAT ((void *)0xe000000c)
4441

45-
#define UART_STAT_THRE (1<<0)
46-
#define UART_STAT_RX_EVT (1<<1)
47-
#define UART_STAT_TX_EVT (1<<2)
42+
#define UART_STAT_TXING (1)
4843

4944
static void __init early_console_putc(char c)
5045
{
51-
unsigned int timeout = 1000;
52-
uint32_t stat;
53-
5446
iowrite32be(c, UART_RXTX);
55-
56-
do {
57-
stat = ioread32be(UART_STAT);
58-
} while (!(stat & UART_STAT_THRE) && --timeout);
47+
while(ioread32be(UART_STAT) & UART_STAT_TXING);
5948
}
6049

6150
static void __init early_console_write(struct console *con, const char *s,

‎arch/lm32/platforms/milkymist/setup.c

-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ void __init plat_setup_arch(void)
88
milkymist_setup_early_printk();
99
#endif
1010
}
11-

0 commit comments

Comments
 (0)
Please sign in to comment.