1/***********************license start*************** 2 * Copyright (c) 2003-2010 Cavium Inc. (support@cavium.com). All rights 3 * reserved. 4 * 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: --- 38 unchanged lines hidden (view full) --- 47 * @file 48 * 49 * Interface to the EBT3000 specific devices 50 * 51 * <hr>$Revision: 70030 $<hr> 52 * 53 */ 54 |
55#if !defined(__FreeBSD__) || !defined(_KERNEL) |
56#include "cvmx-config.h" |
57#endif |
58#include "cvmx.h" |
59#include "cvmx-ebt3000.h" |
60#include "cvmx-sysinfo.h" 61 62 63void ebt3000_char_write(int char_position, char val) 64{ 65 /* Note: phys_to_ptr won't work here, as we are most likely going to access the boot bus. */ |
66 char *led_base = CASTPTR(char , CVMX_ADD_SEG32(CVMX_MIPS32_SPACE_KSEG0, cvmx_sysinfo_get()->led_display_base_addr)); |
67 if (!led_base) 68 return; 69 if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_EBT3000 && cvmx_sysinfo_get()->board_rev_major == 1) 70 { 71 /* Rev 1 board */ 72 char *ptr = (char *)(led_base + 4); 73 char_position &= 0x3; /* only 4 chars */ 74 ptr[3 - char_position] = val; --- 5 unchanged lines hidden (view full) --- 80 char_position &= 0x7; /* only 8 chars */ 81 ptr[char_position] = val; 82 } 83} 84 85void ebt3000_str_write(const char *str) 86{ 87 /* Note: phys_to_ptr won't work here, as we are most likely going to access the boot bus. */ |
88 char *led_base; |
89 if (!cvmx_sysinfo_get()->led_display_base_addr) 90 return; |
91 led_base = CASTPTR(char, CVMX_ADD_SEG32(CVMX_MIPS32_SPACE_KSEG0, cvmx_sysinfo_get()->led_display_base_addr)); |
92 if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_EBT3000 && cvmx_sysinfo_get()->board_rev_major == 1) 93 { 94 char *ptr = (char *)(led_base + 4); 95 int i; 96 for (i=0; i<4; i++) 97 { 98 if (*str) 99 ptr[3 - i] = *str++; --- 18 unchanged lines hidden --- |