View | Details | Raw Unified | Return to bug 251615
Collapse All | Expand All

(-)sys/dev/rt/if_rt.c (-2 / +2 lines)
Lines 288-294 Link Here
288
static int
288
static int
289
ether_request_mac(device_t dev, uint8_t *mac)
289
ether_request_mac(device_t dev, uint8_t *mac)
290
{
290
{
291
	char *var;
291
	const char *var;
292
	/*
292
	/*
293
	 * "ethaddr" is passed via envp on RedBoot platforms
293
	 * "ethaddr" is passed via envp on RedBoot platforms
Lines 312-318 Link Here
312
	 * hint.[dev].[unit].macaddr
312
	 * hint.[dev].[unit].macaddr
313
	 */
313
	 */
314
	if (!resource_string_value(device_get_name(dev),
314
	if (!resource_string_value(device_get_name(dev),
315
	    device_get_unit(dev), "macaddr", (const char **)&var)) {
315
	    device_get_unit(dev), "macaddr", &var)) {
316
		if(!macaddr_atoi(var, mac)) {
316
		if(!macaddr_atoi(var, mac)) {
317
			printf("%s: use %s macaddr from hints\n",
317
			printf("%s: use %s macaddr from hints\n",
318
			    device_get_nameunit(dev), var);
318
			    device_get_nameunit(dev), var);
(-)sys/mips/mediatek/mtk_clock.c (+2 lines)
Lines 123-128 Link Here
123
	if (index < 0 || index > 31 || info == NULL)
123
	if (index < 0 || index > 31 || info == NULL)
124
		return (EINVAL);
124
		return (EINVAL);
125
	mask = (1u << index);
126
125
	if (mtk_sysctl_get(SYSCTL_CLKCFG1) & mask)
127
	if (mtk_sysctl_get(SYSCTL_CLKCFG1) & mask)
126
		info->flags = FDT_CIFLAG_RUNNING;
128
		info->flags = FDT_CIFLAG_RUNNING;
127
	else
129
	else
(-)sys/mips/mediatek/mtk_machdep.c (+3 lines)
Lines 258-263 Link Here
258
	printf("FDT DTB  at: 0x%08x\n", (uint32_t)dtbp);
258
	printf("FDT DTB  at: 0x%08x\n", (uint32_t)dtbp);
259
	printf("CPU   model: %s\n", mtk_soc_get_cpu_model());
259
	printf("CPU   clock: %4dMHz\n", mtk_soc_get_cpuclk()/(1000*1000));
260
	printf("CPU   clock: %4dMHz\n", mtk_soc_get_cpuclk()/(1000*1000));
260
	printf("Timer clock: %4dMHz\n", timer_clk/(1000*1000));
261
	printf("Timer clock: %4dMHz\n", timer_clk/(1000*1000));
261
	printf("UART  clock: %4dMHz\n\n", mtk_soc_get_uartclk()/(1000*1000));
262
	printf("UART  clock: %4dMHz\n\n", mtk_soc_get_uartclk()/(1000*1000));
Lines 264-269 Link Here
264
	printf("U-Boot args (from %d args):\n", argc - 1);
265
	printf("U-Boot args (from %d args):\n", argc - 1);
266
	strcpy(cpu_model, mtk_soc_get_cpu_model());
267
265
	if (argc == 1)
268
	if (argc == 1)
266
		printf("\tNone\n");
269
		printf("\tNone\n");
(-)sys/mips/mediatek/mtk_soc.c (-3 / +10 lines)
Lines 54-59 Link Here
54
static uint32_t mtk_soc_chipid0_3 = MTK_UNKNOWN_CHIPID0_3;
54
static uint32_t mtk_soc_chipid0_3 = MTK_UNKNOWN_CHIPID0_3;
55
static uint32_t mtk_soc_chipid4_7 = MTK_UNKNOWN_CHIPID4_7;
55
static uint32_t mtk_soc_chipid4_7 = MTK_UNKNOWN_CHIPID4_7;
56
static char mtk_soc_cpu_model[64];
56
static const struct ofw_compat_data compat_data[] = {
57
static const struct ofw_compat_data compat_data[] = {
57
	{ "ralink,rt2880-soc",		MTK_SOC_RT2880 },
58
	{ "ralink,rt2880-soc",		MTK_SOC_RT2880 },
Lines 412-425 Link Here
412
	 * obtained for some reason.
413
	 * obtained for some reason.
413
	 */
414
	 */
414
	for (idx = 0; idx < offset; idx++) {
415
	for (idx = 0; idx < offset; idx++) {
415
		cpu_model[idx] = chipid0_3[idx];
416
		mtk_soc_cpu_model[idx] = chipid0_3[idx];
416
		cpu_model[idx + offset] = chipid4_7[idx];
417
		mtk_soc_cpu_model[idx + offset] = chipid4_7[idx];
417
	}
418
	}
418
	/* Null-terminate the string */
419
	/* Null-terminate the string */
419
	cpu_model[2 * offset] = 0;
420
	mtk_soc_cpu_model[2 * offset] = 0;
420
}
421
}
422
const char *
423
mtk_soc_get_cpu_model(void)
424
{
425
	return mtk_soc_cpu_model;
426
}
427
421
uint32_t
428
uint32_t
422
mtk_soc_get_uartclk(void)
429
mtk_soc_get_uartclk(void)
423
{
430
{
(-)sys/mips/mediatek/mtk_soc.h (+1 lines)
Lines 123-128 Link Here
123
extern void     mtk_soc_try_early_detect(void);
123
extern void     mtk_soc_try_early_detect(void);
124
extern void	mtk_soc_set_cpu_model(void);
124
extern void	mtk_soc_set_cpu_model(void);
125
extern const char *mtk_soc_get_cpu_model(void);
125
extern uint32_t mtk_soc_get_uartclk(void);
126
extern uint32_t mtk_soc_get_uartclk(void);
126
extern uint32_t mtk_soc_get_cpuclk(void);
127
extern uint32_t mtk_soc_get_cpuclk(void);
127
extern uint32_t mtk_soc_get_timerclk(void);
128
extern uint32_t mtk_soc_get_timerclk(void);

Return to bug 251615